package cn.iocoder.yudao.module.trade.controller.admin.order.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.ExcelColumnSelect;
import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO;
import cn.iocoder.yudao.module.trade.convert.order.TradeOrderExcelConvert;
import cn.iocoder.yudao.module.trade.enums.ExcelColumnSelectNameConstants;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Schema(description = "管理后台 - 交易订单的分页项 Response VO")
@Data
public class TradeOrderExcelItemVO extends TradeOrderExcelBaseVO {

    @Schema(description = "收件人地区名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "上海 上海市 普陀区")
    @ExcelProperty(value = {"收件人信息", "收件人地区"}, order = 8)
    private String receiverAreaName;

    @Schema(description = "订单项列表", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "订单项", order = 3, converter = TradeOrderExcelConvert.class)
    private List<Item> items;

    @Schema(description = "发货物流公司编号", example = "1024")
    @ExcelProperty(value = "发货物流公司", order = 10, index = 8)
    @ExcelColumnSelect(functionName = ExcelColumnSelectNameConstants.DELIVERY_EXCEL_COLUMN_SELECT)
    private String logistics;

    @Schema(description = "管理后台 - 交易订单的分页项的订单项目")
    @Data
    public static class Item extends TradeOrderItemBaseVO {

        @Schema(description = "属性列表", requiredMode = Schema.RequiredMode.REQUIRED)
        private List<ProductPropertyValueDetailRespVO> properties;

    }

    @ExcelProperty("图片")
    @ColumnWidth(40) // 设置列宽
    private byte[] image;
}
